﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ProyectoNumeros
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            textBox2.Text = "";
            try
            {
                textBox2.Text += (byte.Parse(textBox1.Text)) + " - Это Byte" + "\r\n";
                label1.Text = "да";
            }
            catch (Exception)
            {
                label1.Text = "нет";
            }
            try
            {
                textBox2.Text += (ushort.Parse(textBox1.Text)) + " - Это Ushort" + "\r\n";
                label16.Text = "да";
            }
            catch (Exception)
            {
                label16.Text = "нет";
            }
            try
            {
                textBox2.Text += (sbyte.Parse(textBox1.Text)) + " - Это Sbyte" + "\r\n";
                label14.Text = "да";
            }
            catch (Exception)
            {
                label14.Text = "нет";
            }
            try
            {
                textBox2.Text += (int.Parse(textBox1.Text)) + " - Это Integer" + "\r\n";
                label4.Text = "да";
            }
            catch (Exception)
            {
                label4.Text = "нет";
            }
            try
            {
                textBox2.Text += (short.Parse(textBox1.Text)) + " - Это Short" + "\r\n";
                label6.Text = "да";
            }
            catch (Exception)
            {
                label6.Text = "нет";
            }
            try
            {
                textBox2.Text += (float.Parse(textBox1.Text)) + " - Это Float" + "\r\n";
                label12.Text = "да";
            }
            catch (Exception)
            {
                label12.Text = "нет";
            }
            try
            {
                textBox2.Text += (double.Parse(textBox1.Text)) + " - Это Double" + "\r\n";
                label10.Text = "да";
            }
            catch (Exception)
            {
                label10.Text = "нет";
            }
            try
            {
                textBox2.Text += (long.Parse(textBox1.Text)) + " - Это Long" + "\r\n";
                label8.Text = "да";
            }
            catch (Exception)
            {
                label8.Text = "нет";
            }
        }
    }
}
